package com.six.epidemic.admin.controller

import com.six.library.model.ResultData
import com.six.library.model.ResultInfo
import com.six.library.utils.Constant
import com.six.library.utils.RestTemplateUtils
import org.springframework.web.bind.annotation.*
import javax.annotation.Resource


@RestController
@RequestMapping("/nacos")
@CrossOrigin

class NacosController {
    @Resource
    private lateinit var rtU: RestTemplateUtils

    @RequestMapping("/OK")
    fun OK(): ResultData {
        val data = ResultInfo.setData("SAdaszds")
        println(data.toString())
        return data
    }

    @RequestMapping(value = ["/echo"])
    fun echo(): ResultData? {
        return rtU.getForObject<ResultData>(Constant.Flower, "/flower/selectAll")?.let {
            ResultInfo.setData(
                it
            )
        }
    }


}